package com.cyl.h5.controller;

import com.cyl.h5.service.H5FhMypunctuationService;
import com.cyl.manager.act.domain.convert.FhMypunctuationConvert;
import com.cyl.manager.act.domain.entity.FhMypunctuation;
import com.cyl.manager.act.domain.entity.FhMypunctuation1;
import com.cyl.manager.act.domain.query.FhMypunctuationQuery;
import com.cyl.manager.act.domain.vo.FhMypunctuationVO;
import com.cyl.manager.act.service.FhMypunctuationService;
import com.github.pagehelper.PageHelper;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 我的标点Controller
 *
 * @author zcc
 * @date 2025-04-25
 */
@Api(tags ="我的标点接口列表")
@RestController
@RequestMapping("/app/fhMypunctuation")
public class H5FhMypunctuationController extends BaseController {
    @Autowired
    private H5FhMypunctuationService service;


    @ApiOperation("查询我的标点列表")
    @PostMapping("/list")
    public R<Page<FhMypunctuation1>> list(@RequestBody FhMypunctuationQuery query, Pageable page) {
        List<FhMypunctuation1> list = service.selectList(query, page);
        return R.ok(new PageImpl<>(list, page, list.size()));
    }



    @ApiOperation("获取我的标点详细信息")
    @GetMapping(value = "/{id}")
    public R<FhMypunctuation1> getInfo(@PathVariable("id") Integer id) {
        return R.ok(service.selectById(id));
    }

    @ApiOperation("新增我的标点")
    @PostMapping
    public R<FhMypunctuation> add(@RequestBody FhMypunctuation fhMypunctuation) {
        ;
        return R.ok(service.insert(fhMypunctuation));
    }

    @ApiOperation("修改我的标点")
    @PutMapping
    public R<String> edit(@RequestBody FhMypunctuation fhMypunctuation) {
        service.update(fhMypunctuation);
        return R.ok("修改成功");
    }

    @ApiOperation("删除我的标点")
	@DeleteMapping("/{ids}")
    public R<String> remove(@PathVariable Long[] ids) {
        service.deleteByIds(ids);
        return R.ok("删除成功");
    }
}
